package com.lanou3g.ptp.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Setter;

import java.io.Serializable;

/**
 * 创建人: 武奇
 * 创建事件: 2019/7/30
 */
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class Pageable implements Serializable {

    @ApiModelProperty("分页参数, 页码, 从1开始")
    private Integer page;

    @ApiModelProperty("分页参数, 每页条数, 默认为10")
    private Integer size;

    public Integer getPage() {
        return page == null || page <= 0 ? 1 : page;
    }

    public Integer getSize() {
        return size == null || size <= 0 ? 10 : size;
    }
}
